import {DynamicModule, Global, Module} from '@nestjs/common';
interface options {
    path:string
}
// 全局的动态模块
@Global()
@Module({

})

export class ConfigModule1 {
static forRoot(options:options):DynamicModule {
    return {
        module:ConfigModule1,
        providers:[
            {
                provide:'config',
                useValue:{baseUrl:'/api'+options.path}
            }
        ],
        exports:[
            {
                provide:'config',
                useValue:{baseUrl:'/api'+options.path}
            }
        ]
    }
}
}
